/*
 * Copyright © 2020 ctwing
 */
package scep.ctwing.cn.smartapp.job;

/**
 * 冒泡排序
 *
 * @author:dailm
 * @create at :2020/12/4 11:10
 */
public class BubbleSort {
    public static int[] doSort(int [] datas) {
        //冒泡排序
        for (int i = 0; i < datas.length - 1; i++) {
            for (int j = 0; j < datas.length - 1 - i; j++) {
                if (datas[j] > datas[j + 1]) {
                    int temp = datas[j];
                    datas[j] = datas[j + 1];
                    datas[j + 1] = temp;
                }
            }
        }
        return datas;
    }
}
